﻿#include "UPointInfo.h"
UPointInfo::UPointInfo(CMeasurePoint *pPoint, QWidget *parent)
	: QWidget(parent)
{
	ui.setupUi(this);
	connect(ui.pushButton, &QPushButton::clicked, this, &UPointInfo::slot_editPoint);
	m_pPoint = pPoint;
	ui.lineEdit_RobName->setText(m_pPoint->getName());
	ui.lineEdit_7->setText(m_pPoint->getParent()->getName());
}

UPointInfo::~UPointInfo()
{}

void UPointInfo::slot_editPoint()
{
	CBaseNode *pNode = m_pPoint->getParent();
	CBaseNode *pNodeParent = m_pPoint->getParent();
	while (1)
	{
		pNodeParent = pNode->getParent();
		if (pNodeParent != nullptr)
		{
			pNode = pNodeParent;
		}
		else
		{
			break;
		}
	}
	m_pEdit = new UEditPoint(pNode);
	m_pEdit->show();
}
